/*
 *  CSGameRecord.h  
 */
#ifndef _CSGAMERECORD_H
#define _CSGAMERECORD_H

#include <string>
using namespace std;
#include "threadpool.h"

#define SELECTSIZE 300	

class CCSGameRecord : public CJoyAsyObject
{
public:
	CCSGameRecord();
	~CCSGameRecord();

public:
	BOOL CreateConn();
	BOOL ExecuteConn();
	HRESULT OpenRecordset(_variant_t vQuery);
	HRESULT OpenTable(_variant_t vTable);
	HRESULT AddRecord();
	HRESULT UpdateRecordset();
	FieldPtr GetFieldItem(_variant_t vFieldName);
	HRESULT MoveFirst();
	HRESULT MoveNext();
	VARIANT_BOOL EndOfRecord();
	long Record_Count();

public:
	void Put_CommText(_bstr_t bstrCommText);

public:
	BOOL MapIdByName(const string &strMapName, int *nMapID);
	BOOL CheckUserRecord(int nUserID, int nMapID, const string &strTable);
	BOOL CheckUserRecord(int nUserID, int nMapID, int nWeaponID, const string &strTable);

public:
	void OnExecute();

private:
	_ConnectionPtr m_pConn;
	_RecordsetPtr m_pRs;
	TCHAR bstrConn[300];
	_bstr_t m_bstrCommText;
};

#endif
